<template>
<div class="father">
    <h3>父组件</h3>
    <p>汽车： {{ car }}</p>
    <p>获取子组件数据： {{ toy }}</p>
    <Child :car="car" :sendToy="getToy"/>
</div>
</template>

<script lang="ts" setup name="Father">
import { ref } from 'vue';
import Child from './Child.vue'
let car = ref('奔驰')
let toy = ref('')
function getToy(value:string){
    toy.value = value
}
</script>

<style scoped>
.father{
    background-color: rgb(164, 164, 164);
    padding: 20px;
    border-radius: 10px;
}
</style>